﻿@Cofe ?= {}

MetaItem = Cofe.MetaItem

# Populate a list of metadata from 
class MetadataList
  constructor : (entry, data) ->
    @array = new Array()
    @tagsArray = if data["tags"] is null then [] else (data["tags"].split(",")).sort()
    @text = ""
    
    for d of data when entry[d] is undefined
       @[d] = data[d]
       @array.push({key : d, value : data[d] })
       @text += d + " : " + data[d] + " <br/>"

  toString : () ->
    @text

Cofe.MetadataList = MetadataList